#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
int main()
{
    pid_t id = fork();

    if(id > 0)
    {
        printf("i'm parent process id:%d\n ",getpid());
        sleep(3);
        return 0;
    }

    if(id == 0)
    {
        printf("i'm a child process id:%d  ppid:%d\n",getpid(),getppid());
        sleep(10);
    }
    else
    {
        perror("fork");
        return 1;
    }

    return 0;
}
